home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue37 / outlook / mapi / mapispi.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-06-19  |  26.7 KB  |  650 lines

  1. {++
  2.  
  3.   m a p i s p i . p a s
  4.  
  5.   Abstract:
  6.  
  7.     Automatic conversion of mapispi.h.
  8.  
  9.   Comments:
  10.  
  11.     This source file automatically converted by
  12.     htrans 0.91 beta 1 Copyright (c) 1997 Alexander Staubo
  13.  
  14.   Revision history:
  15.  
  16.     18-06-1997 20:53 alex  [Autogenerated]
  17.     18-06-1997 20:53 alex  Retouched for release
  18.  
  19. --}
  20.  
  21. unit MapiSpi;
  22.  
  23. interface
  24.  
  25. uses
  26.   Windows, SysUtils, ActiveX,
  27.   mapidefs, mapix, mapiguid, mapicode;
  28.  
  29.  
  30. (*
  31.  *  M A P I S P I . H
  32.  *
  33.  *  Defines the calls and structures exchanged between MAPI or the spooler
  34.  *  and the MAPI service providers
  35.  *
  36.  *  Copyright 1986-1996 Microsoft Corporation. All Rights Reserved.
  37.  *)
  38.  
  39.  
  40. (*  The MAPI SPI has a version number.  MAPIX.DLL knows and supports
  41.  *  one or more versions of the SPI.  Each provider supports one or
  42.  *  more versions of the SPI.  Checks are performed in both MAPIX.DLL
  43.  *  and in the provider to ensure that they agree to use exactly one
  44.  *  version of the MAPI SPI.
  45.  *
  46.  *  The SPI version number is composed of a major (8-bit) version,
  47.  *  minor (8-bit) version, and micro (16-bit) version.  The first
  48.  *  retail ship of MAPI 1.0 is expected to be version 1.0.0.
  49.  *  The major version number changes rarely.
  50.  *  The minor version number changes opon each retail ship of
  51.  *  MAPI if the SPI has been modified.
  52.  *  The micro version number changes internally at Microsoft
  53.  *  during development of MAPI.
  54.  *
  55.  *  The version of the SPI documented by this set of header files
  56.  *  is ALWAYS known as "CURRENT_SPI_VERSION".  If you write a
  57.  *  service provider, and get a new set of header files, and update
  58.  *  your code to the new interface, you'll be at the "current" version.
  59.  *)
  60.  
  61.  const CURRENT_SPI_VERSION  = $00010010;
  62.  
  63. (* Here are some well-known SPI version numbers:
  64.  *  (These will eventually be useful for provider-writers who
  65.  *  might choose to make provider DLLs that support more than
  66.  *  one version of the MAPI SPI.
  67.  *)
  68.  
  69. const PDK1_SPI_VERSION     = $00010000 { 0.1.0  MAPI PDK1 Spring 1993 };
  70.  
  71. const PDK2_SPI_VERSION     = $00010008 { 0.1.8  MAPI PDK2 Spring 1994 };
  72.  
  73. const PDK3_SPI_VERSION     = $00010010 { 0.1.16 MAPI PDK3 Fall 1994   };
  74.  
  75. (*
  76.  * Forward declaration of interface pointers specific to the service
  77.  * provider interface.
  78.  *)
  79.  
  80.  
  81. { IMAPISupport Interface -------------------------------------------------- }
  82.  
  83. { Notification key structure for the MAPI notification engine }
  84.  
  85. type
  86.   TNOTIFKEY =
  87.     record
  88.       cb : ULONG;                      { How big the key is }
  89.       ab : array[0..MAPI_DIM - 1]
  90.         of Byte;                       { Key contents }
  91.     end;
  92.  
  93.   PNOTIFKEY = ^TNOTIFKEY;
  94.  
  95. { For Subscribe() }
  96.  
  97. const NOTIFY_SYNC              = ULONG( $40000000);
  98.  
  99. { For Notify() }
  100.  
  101. const NOTIFY_CANCELED          = ULONG( $80000000);
  102.  
  103. { From the Notification Callback function (well, this is really a ulResult) }
  104.  
  105. const CALLBACK_DISCONTINUE     = ULONG( $80000000);
  106.  
  107. { For Transport's SpoolerNotify() }
  108.  
  109. const NOTIFY_NEWMAIL           = ULONG( $00000001);
  110. const NOTIFY_READYTOSEND       = ULONG( $00000002);
  111. const NOTIFY_SENTDEFERRED      = ULONG( $00000004);
  112. const NOTIFY_CRITSEC           = ULONG( $00001000);
  113. const NOTIFY_NONCRIT           = ULONG( $00002000);
  114. const NOTIFY_CONFIG_CHANGE     = ULONG( $00004000);
  115. const NOTIFY_CRITICAL_ERROR    = ULONG( $10000000);
  116.  
  117. { For Message Store's SpoolerNotify() }
  118.  
  119. const NOTIFY_NEWMAIL_RECEIVED  = ULONG( $20000000);
  120.  
  121. { For ModifyStatusRow() }
  122.  
  123. const STATUSROW_UPDATE         = ULONG( $10000000);
  124.  
  125. { For IStorageFromStream() }
  126.  
  127. const STGSTRM_RESET            = ULONG( $00000000);
  128. const STGSTRM_CURRENT          = ULONG( $10000000);
  129. const STGSTRM_MODIFY           = ULONG( $00000002);
  130. const STGSTRM_CREATE           = ULONG( $00001000);
  131.  
  132. { For GetOneOffTable() }
  133. {***** MAPI_UNICODE            ((ULONG) 0x80000000) }
  134.  
  135. { For CreateOneOff() }
  136. {***** MAPI_UNICODE            ((ULONG) 0x80000000) }
  137. {***** MAPI_SEND_NO_RICH_INFO  ((ULONG) 0x00010000) }
  138.  
  139. { For ReadReceipt() }
  140. const MAPI_NON_READ            = ULONG( $00000001);
  141.  
  142. { For DoConfigPropSheet() }
  143. {***** MAPI_UNICODE            ((ULONG) 0x80000000) }
  144.  
  145. { Preprocessor calls: }
  146.  
  147. { PreprocessMessage, first ordinal in RegisterPreprocessor(). }
  148.  
  149. type
  150.   TPREPROCESSMESSAGE = function (lpvSession : Pointer; lpMessage : IMessage;
  151.     lpAdrBook : IAddrBook; lpFolder : IMAPIFolder;
  152.     AllocateBuffer : PALLOCATEBUFFER; AllocateMore : PALLOCATEMORE;
  153.     FreeBuffer : PFREEBUFFER; var lpcOutbound : ULONG;
  154.     var lpppMessage : IMessage;
  155.     var lppRecipList : PADRLIST) : HResult; stdcall;
  156.  
  157. { RemovePreprocessInfo, second ordinal in RegisterPreprocessor(). }
  158.  
  159. type
  160.   TREMOVEPREPROCESSINFO = function (lpMessage : IMessage) : HResult; stdcall; 
  161.  
  162. { Function pointer for GetReleaseInfo }
  163.  
  164. type
  165.   IMAPISupport =
  166.     interface(IUnknown)
  167.     [strIID_IMAPISup]
  168.       function GetLastError (hResult : HResult; ulFlags : ULONG;
  169.         var lppMAPIError : PMAPIERROR) : HResult; stdcall;
  170.       function GetMemAllocRoutines (var lpAllocateBuffer : PALLOCATEBUFFER;
  171.         var lpAllocateMore : PALLOCATEMORE;
  172.         var lpFreeBuffer : PFREEBUFFER) : HResult; stdcall;
  173.       function Subscribe (lpKey : PNOTIFKEY; ulEventMask : ULONG;
  174.         ulFlags : ULONG; lpAdviseSink : IMAPIAdviseSink;
  175.         var lpulConnection : ULONG) : HResult; stdcall;
  176.       function Unsubscribe (ulConnection : ULONG) : HResult; stdcall;
  177.       function Notify (lpKey : PNOTIFKEY; cNotification : ULONG;
  178.         lpNotifications : PNOTIFICATION;
  179.         var lpulFlags : ULONG) : HResult; stdcall;
  180.       function ModifyStatusRow (cValues : ULONG; lpColumnVals : PSPropValue;
  181.         ulFlags : ULONG) : HResult; stdcall;
  182.       function OpenProfileSection (lpUid : PMAPIUID; ulFlags : ULONG;
  183.         var lppProfileObj : IProfSect) : HResult; stdcall;
  184.       function RegisterPreprocessor (lpMuid : PMAPIUID; lpszAdrType : PChar;
  185.         lpszDLLName : PChar; lpszPreprocess : { String8! }LPSTR;
  186.         lpszRemovePreprocessInfo : { String8! }LPSTR;
  187.         ulFlags : ULONG) : HResult; stdcall;
  188.       function NewUID (lpMuid : PMAPIUID) : HResult; stdcall;
  189.       function MakeInvalid (ulFlags : ULONG; lpObject : Pointer;
  190.         ulRefCount : ULONG; cMethods : ULONG) : HResult; stdcall;
  191.       function SpoolerYield (ulFlags : ULONG) : HResult; stdcall;
  192.       function SpoolerNotify (ulFlags : ULONG;
  193.         lpvData : Pointer) : HResult; stdcall;
  194.       function CreateOneOff (lpszName : PChar; lpszAdrType : PChar;
  195.         lpszAddress : PChar; ulFlags : ULONG; var lpcbEntryID : ULONG;
  196.         var lppEntryID : PENTRYID) : HResult; stdcall;
  197.       function SetProviderUID (lpProviderID : PMAPIUID;
  198.         ulFlags : ULONG) : HResult; stdcall;
  199.       function CompareEntryIDs (cbEntry1 : ULONG; lpEntry1 : PENTRYID;
  200.         cbEntry2 : ULONG; lpEntry2 : PENTRYID; ulCompareFlags : ULONG;
  201.         var lpulResult : ULONG) : HResult; stdcall;
  202.       function OpenTemplateID (cbTemplateID : ULONG; lpTemplateID : PENTRYID;
  203.         ulTemplateFlags : ULONG; lpMAPIPropData : IMAPIProp;
  204.         lpInterface : PIID; var lppMAPIPropNew : IMAPIProp;
  205.         lpMAPIPropSibling : IMAPIProp) : HResult; stdcall;
  206.       function OpenEntry (cbEntryID : ULONG; lpEntryID : PENTRYID;
  207.         lpInterface : PIID; ulOpenFlags : ULONG; var lpulObjType : ULONG;
  208.         var lppUnk : IUnknown) : HResult; stdcall;
  209.       function GetOneOffTable (ulFlags : ULONG;
  210.         var lppTable : IMAPITable) : HResult; stdcall;
  211.       function Address (var lpulUIParam : ULONG; lpAdrParms : PADRPARM;
  212.         var lppAdrList : PADRLIST) : HResult; stdcall;
  213.       function Details (var lpulUIParam : ULONG; lpfnDismiss : PFNDISMISS;
  214.         lpvDismissContext : Pointer; cbEntryID : ULONG; lpEntryID : PENTRYID;
  215.         lpfButtonCallback : PFNBUTTON; lpvButtonContext : Pointer;
  216.         lpszButtonText : PChar; ulFlags : ULONG) : HResult; stdcall;
  217.       function NewEntry (ulUIParam : ULONG; ulFlags : ULONG;
  218.         cbEIDContainer : ULONG; lpEIDContainer : PENTRYID;
  219.         cbEIDNewEntryTpl : ULONG; lpEIDNewEntryTpl : PENTRYID;
  220.         var lpcbEIDNewEntry : ULONG;
  221.         var lppEIDNewEntry : PENTRYID) : HResult; stdcall;
  222.       function DoConfigPropsheet (ulUIParam : ULONG; ulFlags : ULONG;
  223.         lpszTitle : PChar; lpDisplayTable : IMAPITable;
  224.         lpCOnfigData : IMAPIProp; ulTopPage : ULONG) : HResult; stdcall;
  225.       function CopyMessages (lpSrcInterface : PIID; lpSrcFolder : Pointer;
  226.         lpMsgList : PENTRYLIST; lpDestInterface : PIID; lpDestFolder : Pointer;
  227.         ulUIParam : ULONG; lpProgress : IMAPIProgress;
  228.         ulFlags : ULONG) : HResult; stdcall;
  229.       function CopyFolder (lpSrcInterface : PIID; lpSrcFolder : Pointer;
  230.         cbEntryID : ULONG; lpEntryID : PENTRYID; lpDestInterface : PIID;
  231.         lpDestFolder : Pointer; lszNewFolderName : PChar; ulUIParam : ULONG;
  232.         lpProgress : IMAPIProgress; ulFlags : ULONG) : HResult; stdcall;
  233.       function DoCopyTo (lpSrcInterface : PIID; lpSrcObj : Pointer;
  234.         ciidExclude : ULONG; rgiidExclude : PIID;
  235.         lpExcludeProps : PSPropTagArray; ulUIParam : ULONG;
  236.         lpProgress : IMAPIProgress; lpDestInterface : PIID;
  237.         lpDestObj : Pointer; ulFlags : ULONG;
  238.         var lppProblems : PSPropProblemArray) : HResult; stdcall;
  239.       function DoCopyProps (lpSrcInterface : PIID; lpSrcObj : Pointer;
  240.         lpIncludeProps : PSPropTagArray; ulUIParam : ULONG;
  241.         lpProgress : IMAPIProgress; lpDestInterface : PIID;
  242.         lpDestObj : Pointer; ulFlags : ULONG;
  243.         var lppProblems : PSPropProblemArray) : HResult; stdcall;
  244.       function DoProgressDialog (ulUIParam : ULONG; ulFlags : ULONG;
  245.         var lppProgress : IMAPIProgress) : HResult; stdcall;
  246.       function ReadReceipt (ulFlags : ULONG; lpReadMessage : IMessage;
  247.         var lppEmptyMessage : IMessage) : HResult; stdcall;
  248.       function PrepareSubmit (lpMessage : IMessage;
  249.         var lpulFlags : ULONG) : HResult; stdcall;
  250.       function ExpandRecips (lpMessage : IMessage;
  251.         var lpulFlags : ULONG) : HResult; stdcall;
  252.       function UpdatePAB (ulFlags : ULONG;
  253.         lpMessage : IMessage) : HResult; stdcall;
  254.       function DoSentMail (ulFlags : ULONG;
  255.         lpMessage : IMessage) : HResult; stdcall;
  256.       function OpenAddressBook (lpInterface : PIID; ulFlags : ULONG;
  257.         var lppAdrBook : IAddrBook) : HResult; stdcall;
  258.       function Preprocess (ulFlags : ULONG; cbEntryID : ULONG;
  259.         lpEntryID : PENTRYID) : HResult; stdcall;
  260.       function CompleteMsg (ulFlags : ULONG; cbEntryID : ULONG;
  261.         lpEntryID : PENTRYID) : HResult; stdcall;
  262.       function StoreLogoffTransports (var lpulFlags :
  263.         ULONG) : HResult; stdcall;
  264.       function StatusRecips (lpMessage : IMessage;
  265.         lpRecipList : PADRLIST) : HResult; stdcall;
  266.       function WrapStoreEntryID (cbOrigEntry : ULONG; lpOrigEntry : PENTRYID;
  267.         var lpcbWrappedEntry : ULONG;
  268.         var lppWrappedEntry : PENTRYID) : HResult; stdcall;
  269.       function ModifyProfile (ulFlags : ULONG) : HResult; stdcall;
  270.       function IStorageFromStream (lpUnkIn : IUnknown; lpInterface : PIID;
  271.         ulFlags : ULONG; var lppStorageOut : IStorage) : HResult; stdcall;
  272.       function GetSvcConfigSupportObj (ulFlags : ULONG;
  273.         var lppSvcSupport : IMAPISupport) : HResult; stdcall;
  274.     end;
  275.  
  276. {******************************************************************}
  277. {                                                                  }
  278. {                          ADDRESS BOOK SPI                        }
  279. {                                                                  }
  280. {******************************************************************}
  281.  
  282. { Address Book Provider ------------------------------------------------- }
  283.  
  284. { OpenTemplateID() }
  285. const FILL_ENTRY               = ULONG( $00000001);
  286.  
  287. { For Logon() }
  288.  
  289. {#define AB_NO_DIALOG          ((ULONG) 0x00000001) in mapidefs.h }
  290. {#define MAPI_UNICODE          ((ULONG) 0x80000000) in mapidefs.h }
  291.  
  292. type
  293.   IABLogon = interface;
  294.  
  295.   IABProvider =
  296.     interface(IUnknown)
  297.     [strIID_IABProvider]  
  298.       function Shutdown (var lpulFlags : ULONG) : HResult; stdcall;
  299.       function Logon (lpMAPISup : IMAPISupport; ulUIParam : ULONG;
  300.         lpszProfileName : PChar; ulFlags : ULONG; var lpulpcbSecurity : ULONG;
  301.         var lppbSecurity : PBYTE; var lppMAPIError : PMAPIERROR;
  302.         var lppABLogon : IABLogon) : HResult; stdcall;
  303.     end;
  304.  
  305. { For GetOneOffTable() }
  306. {***** MAPI_UNICODE            ((ULONG) 0x80000000) }
  307.  
  308.   IABLogon =
  309.     interface(IUnknown)
  310.     [strIID_IABLogon]
  311.       function GetLastError (hResult : HResult; ulFlags : ULONG;
  312.         var lppMAPIError : PMAPIERROR) : HResult; stdcall;
  313.       function Logoff (ulFlags : ULONG) : HResult; stdcall;
  314.       function OpenEntry (cbEntryID : ULONG; lpEntryID : PENTRYID;
  315.         lpInterface : PIID; ulFlags : ULONG; var lpulObjType : ULONG;
  316.         var lppUnk : IUnknown) : HResult; stdcall;
  317.       function CompareEntryIDs (cbEntryID1 : ULONG; lpEntryID1 : PENTRYID;
  318.         cbEntryID2 : ULONG; lpEntryID2 : PENTRYID; ulFlags : ULONG;
  319.         var lpulResult : ULONG) : HResult; stdcall;
  320.       function Advise (cbEntryID : ULONG; lpEntryID : PENTRYID;
  321.         ulEventMask : ULONG; lpAdviseSink : IMAPIAdviseSink;
  322.         var lpulConnection : ULONG) : HResult; stdcall;
  323.       function Unadvise (ulConnection : ULONG) : HResult; stdcall;
  324.       function OpenStatusEntry (lpInterface : PIID; ulFlags : ULONG;
  325.         var lpulObjType : ULONG; var lppEntry : IMAPIStatus) : HResult; stdcall;
  326.       function OpenTemplateID (cbTemplateID : ULONG; lpTemplateID : PENTRYID;
  327.         ulTemplateFlags : ULONG; lpMAPIPropData : IMAPIProp;
  328.         lpInterface : PIID; var lppMAPIPropNew : IMAPIProp;
  329.         lpMAPIPropSibling : IMAPIProp) : HResult; stdcall;
  330.       function GetOneOffTable (ulFlags : ULONG;
  331.         var lppTable : IMAPITable) : HResult; stdcall;
  332.       function PrepareRecips (ulFlags : ULONG; lpPropTagArray : PSPropTagArray;
  333.         lpRecipList : PADRLIST) : HResult; stdcall;
  334.     end;
  335.  
  336. {!! Note: Address book providers export a function called "ABProviderInit"
  337.   following the syntax of this function declaration }
  338.  
  339.   TABPROVIDERINIT = function (hInstance : HINST; lpMalloc : IMalloc;
  340.     lpAllocateBuffer : PALLOCATEBUFFER; lpAllocateMore : PALLOCATEMORE;
  341.     lpFreeBuffer : PFREEBUFFER; ulFlags : ULONG; ulMAPIVer : ULONG;
  342.     var lpulProviderVer : ULONG;
  343.     var lppABProvider : IABProvider) : HResult; cdecl;
  344.  
  345. {******************************************************************}
  346. {                                                                  }
  347. {                          TRANSPORT SPI                           }
  348. {                                                                  }
  349. {******************************************************************}
  350.  
  351. { For DeinitTransport }
  352.  
  353. const DEINIT_NORMAL                = ULONG( $00000001);
  354. const DEINIT_HURRY                 = ULONG( $80000000);
  355.  
  356. { For TransportLogon }
  357.  
  358. { Flags that the Spooler may pass to the transport: }
  359.  
  360. const LOGON_NO_DIALOG              = ULONG( $00000001);
  361. const LOGON_NO_CONNECT             = ULONG( $00000004);
  362. const LOGON_NO_INBOUND             = ULONG( $00000008);
  363. const LOGON_NO_OUTBOUND            = ULONG( $00000010);
  364. {#define MAPI_UNICODE              ((ULONG) 0x80000000) in mapidefs.h }
  365.  
  366. { Flags that the transport may pass to the Spooler: }
  367.  
  368. const LOGON_SP_IDLE                = ULONG( $00010000);
  369. const LOGON_SP_POLL                = ULONG( $00020000);
  370. const LOGON_SP_RESOLVE             = ULONG( $00040000);
  371.  
  372. { OptionData returned from call to RegisterOptions }
  373.  
  374. const OPTION_TYPE_RECIPIENT        = ULONG( $00000001);
  375. const OPTION_TYPE_MESSAGE          = ULONG( $00000002);
  376.  
  377. type
  378.   TOPTIONDATA =
  379.     record
  380.       ulFlags : ULONG;                 { MAPI_RECIPIENT, MAPI_MESSAGE }
  381.       lpRecipGUID : PGUID;             { Same as returned by AddressTypes() }
  382.       lpszAdrType : PChar;             { Same as returned by AddressTypes() }
  383.       lpszDLLName : PChar;             { Options DLL }
  384.       ulOrdinal : ULONG;               { Ordinal in that DLL }
  385.       cbOptionsData : ULONG;           { Count of bytes in lpbOptionsData }
  386.       lpbOptionsData : PBYTE;          { Providers per [recip|message] option data }
  387.       cOptionsProps : ULONG;           { Count of Options default prop values }
  388.       lpOptionsProps : PSPropValue;    { Default Options property values }
  389.     end;
  390.  
  391.   POPTIONDATA = ^TOPTIONDATA;
  392.  
  393.   TOPTIONCALLBACK = function (hInst : HINST; lpMalloc : IMalloc;
  394.     ulFlags : ULONG; cbOptionData : ULONG; lpbOptionData : PBYTE;
  395.     lpMAPISup : IMAPISupport; lpDataSource : IMAPIProp;
  396.     var lppWrappedSource : IMAPIProp;
  397.     var lppMAPIError : PMAPIERROR) : SCODE; cdecl;
  398.  
  399. { For XP_AddressTypes }
  400.  
  401. {#define MAPI_UNICODE              ((ULONG) 0x80000000) in mapidefs.h }
  402.  
  403. { For XP_RegisterRecipOptions }
  404.  
  405. {#define MAPI_UNICODE              ((ULONG) 0x80000000) in mapidefs.h }
  406.  
  407. { For XP_RegisterMessageOptions }
  408.  
  409. {#define MAPI_UNICODE              ((ULONG) 0x80000000) in mapidefs.h }
  410.  
  411. { For TransportNotify }
  412.  
  413. const NOTIFY_ABORT_DEFERRED        = ULONG( $40000000);
  414. const NOTIFY_CANCEL_MESSAGE        = ULONG( $80000000);
  415. const NOTIFY_BEGIN_INBOUND         = ULONG( $00000001);
  416. const NOTIFY_END_INBOUND           = ULONG( $00010000);
  417. const NOTIFY_BEGIN_OUTBOUND        = ULONG( $00000002);
  418. const NOTIFY_END_OUTBOUND          = ULONG( $00020000);
  419. const NOTIFY_BEGIN_INBOUND_FLUSH   = ULONG( $00000004);
  420. const NOTIFY_END_INBOUND_FLUSH     = ULONG( $00040000);
  421. const NOTIFY_BEGIN_OUTBOUND_FLUSH  = ULONG( $00000008);
  422. const NOTIFY_END_OUTBOUND_FLUSH    = ULONG( $00080000);
  423.  
  424. { For TransportLogoff }
  425.  
  426. const LOGOFF_NORMAL                = ULONG( $00000001);
  427. const LOGOFF_HURRY                 = ULONG( $80000000);
  428.  
  429. { For SubmitMessage }
  430.  
  431. const BEGIN_DEFERRED               = ULONG( $00000001);
  432.  
  433. { For EndMessage }
  434.  
  435. { Flags that the Spooler may pass to the Transport: }
  436.  
  437. { Flags that the transport may pass to the Spooler: }
  438.  
  439. const END_RESEND_NOW               = ULONG( $00010000);
  440. const END_RESEND_LATER             = ULONG( $00020000);
  441. const END_DONT_RESEND              = ULONG( $00040000);
  442.  
  443. type
  444.   IXPLogon = interface;
  445.  
  446.   IXPProvider =
  447.     interface(IUnknown)
  448.     [strIID_IXPProvider]
  449.       function Shutdown (var lpulFlags : ULONG) : HResult; stdcall;
  450.       function TransportLogon (lpMAPISup : IMAPISupport; ulUIParam : ULONG;
  451.         lpszProfileName : PChar; var lpulFlags : ULONG;
  452.         var lppMAPIError : PMAPIERROR;
  453.         var lppXPLogon : IXPLogon) : HResult; stdcall;
  454.     end;
  455.  
  456.   IXPLogon =
  457.     interface(IUnknown)
  458.     [strIID_IXPLogon]
  459.       function AddressTypes (var lpulFlags : ULONG; var lpcAdrType : ULONG;
  460.         var lpppAdrTypeArray : PChar; var lpcMAPIUID : ULONG;
  461.         var lpppUIDArray : PMAPIUID) : HResult; stdcall;
  462.       function RegisterOptions (var lpulFlags : ULONG; var lpcOptions : ULONG;
  463.         var lppOptions : POPTIONDATA) : HResult; stdcall;
  464.       function TransportNotify (var lpulFlags : ULONG;
  465.         var lppvData : Pointer) : HResult; stdcall;
  466.       function Idle (ulFlags : ULONG) : HResult; stdcall;
  467.       function TransportLogoff (ulFlags : ULONG) : HResult; stdcall;
  468.       function SubmitMessage (ulFlags : ULONG; lpMessage : IMessage;
  469.         var lpulMsgRef : ULONG; var lpulReturnParm : ULONG) : HResult; stdcall;
  470.       function EndMessage (ulMsgRef : ULONG;
  471.         var lpulFlags : ULONG) : HResult; stdcall;
  472.       function Poll (var lpulIncoming : ULONG) : HResult; stdcall;
  473.       function StartMessage (ulFlags : ULONG; lpMessage : IMessage;
  474.         var lpulMsgRef : ULONG) : HResult; stdcall;
  475.       function OpenStatusEntry (lpInterface : PIID; ulFlags : ULONG;
  476.         var lpulObjType : ULONG; var lppEntry : IMAPIStatus) : HResult; stdcall;
  477.       function ValidateState (ulUIParam : ULONG;
  478.         ulFlags : ULONG) : HResult; stdcall;
  479.       function FlushQueues (ulUIParam : ULONG; cbTargetTransport : ULONG;
  480.         lpTargetTransport : PENTRYID; ulFlags : ULONG) : HResult; stdcall;
  481.     end;
  482.  
  483. { Transport Provider Entry Point }
  484.  
  485. type
  486.   TXPPROVIDERINIT = function (hInstance : HINST; lpMalloc : IMalloc;
  487.     lpAllocateBuffer : PALLOCATEBUFFER; lpAllocateMore : PALLOCATEMORE;
  488.     lpFreeBuffer : PFREEBUFFER; ulFlags : ULONG; ulMAPIVer : ULONG;
  489.     var lpulProviderVer : ULONG;
  490.     var lppXPProvider : IXPProvider) : HResult; cdecl; 
  491.  
  492. {******************************************************************}
  493. {                                                                  }
  494. {                          MESSAGE STORE SPI                       }
  495. {                                                                  }
  496. {******************************************************************}
  497.  
  498. { Flags and enums }
  499.  
  500. { For Logon() }
  501.  
  502. {#define MAPI_UNICODE          ((ULONG) 0x80000000) in mapidefs.h }
  503. {#define MDB_NO_DIALOG         ((ULONG) 0x00000001) in mapidefs.h }
  504. {#define MDB_WRITE             ((ULONG) 0x00000004) in mapidefs.h }
  505. {#define MAPI_DEFERRED_ERRORS  ((ULONG) 0x00000008) in mapidefs.h }
  506. {#define MDB_TEMPORARY         ((ULONG) 0x00000020) in mapidefs.h }
  507. {#define MDB_NO_MAIL           ((ULONG) 0x00000080) in mapidefs.h }
  508.  
  509. { For SpoolerLogon() }
  510.  
  511. {#define MAPI_UNICODE          ((ULONG) 0x80000000) in mapidefs.h }
  512. {#define MDB_NO_DIALOG         ((ULONG) 0x00000001) in mapidefs.h }
  513. {#define MDB_WRITE             ((ULONG) 0x00000004) in mapidefs.h }
  514. {#define MAPI_DEFERRED_ERRORS  ((ULONG) 0x00000008) in mapidefs.h }
  515.  
  516. { GetCredentials, SetCredentials }
  517.  
  518. const LOGON_SP_TRANSPORT       = ULONG( $00000001);
  519. const LOGON_SP_PROMPT          = ULONG( $00000002);
  520. const LOGON_SP_NEWPW           = ULONG( $00000004);
  521. const LOGON_CHANGED            = ULONG( $00000008);
  522.  
  523. { DoMCDialog }
  524.  
  525. const DIALOG_FOLDER            = ULONG( $00000001);
  526. const DIALOG_MESSAGE           = ULONG( $00000002);
  527. const DIALOG_PROP              = ULONG( $00000004);
  528. const DIALOG_ATTACH            = ULONG( $00000008);
  529.  
  530. const DIALOG_MOVE              = ULONG( $00000010);
  531. const DIALOG_COPY              = ULONG( $00000020);
  532. const DIALOG_DELETE            = ULONG( $00000040);
  533.  
  534. const DIALOG_ALLOW_CANCEL      = ULONG( $00000080);
  535. const DIALOG_CONFIRM_CANCEL    = ULONG( $00000100);
  536.  
  537. { ExpandRecips }
  538.  
  539. const NEEDS_PREPROCESSING      = ULONG( $00000001);
  540. const NEEDS_SPOOLER            = ULONG( $00000002);
  541.  
  542. { PrepareSubmit }
  543.  
  544. const CHECK_SENDER             = ULONG( $00000001);
  545. const NON_STANDARD             = ULONG( $00010000);
  546.  
  547. { Message Store Provider Interface (IMSPROVIDER) }
  548.  
  549. type
  550.   IMsLogon = interface;
  551.  
  552.   IMSProvider =
  553.     interface(IUnknown)
  554.     [strIID_IMSProvider]
  555.       function Shutdown (var lpulFlags : ULONG) : HResult; stdcall;
  556.       function Logon (lpMAPISup : IMAPISupport; ulUIParam : ULONG;
  557.         lpszProfileName : PChar; cbEntryID : ULONG; lpEntryID : PENTRYID;
  558.         ulFlags : ULONG; lpInterface : PIID; var lpcbSpoolSecurity : ULONG;
  559.         var lppbSpoolSecurity : PBYTE; var lppMAPIError : PMAPIERROR;
  560.         var lppMSLogon : IMSLogon; var lppMDB : IMsgStore) : HResult; stdcall;
  561.       function SpoolerLogon (lpMAPISup : IMAPISupport; ulUIParam : ULONG;
  562.         lpszProfileName : PChar; cbEntryID : ULONG; lpEntryID : PENTRYID;
  563.         ulFlags : ULONG; lpInterface : PIID; cbSpoolSecurity : ULONG;
  564.         lpbSpoolSecurity : PBYTE; var lppMAPIError : PMAPIERROR;
  565.         var lppMSLogon : IMSLogon; var lppMDB : IMsgStore) : HResult; stdcall;
  566.       function CompareStoreIDs (cbEntryID1 : ULONG; lpEntryID1 : PENTRYID;
  567.         cbEntryID2 : ULONG; lpEntryID2 : PENTRYID; ulFlags : ULONG;
  568.         var lpulResult : ULONG) : HResult; stdcall; 
  569.     end; 
  570.  
  571. { The MSLOGON object is returned by the Logon () method of the
  572.  * MSPROVIDER interface.  This object is for use by MAPIX.DLL.
  573.  }
  574.  
  575.   IMSLogon =
  576.     interface(IUnknown)
  577.     [strIID_IMSLogon]
  578.       function GetLastError (hResult : HResult; ulFlags : ULONG;
  579.         var lppMAPIError : PMAPIERROR) : HResult; stdcall;
  580.       function Logoff (var lpulFlags : ULONG) : HResult; stdcall;
  581.       function OpenEntry (cbEntryID : ULONG; lpEntryID : PENTRYID;
  582.         lpInterface : PIID; ulFlags : ULONG; var lpulObjType : ULONG;
  583.         var lppUnk : IUnknown) : HResult; stdcall;
  584.       function CompareEntryIDs (cbEntryID1 : ULONG; lpEntryID1 : PENTRYID;
  585.         cbEntryID2 : ULONG; lpEntryID2 : PENTRYID; ulFlags : ULONG;
  586.         var lpulResult : ULONG) : HResult; stdcall;
  587.       function Advise (cbEntryID : ULONG; lpEntryID : PENTRYID;
  588.         ulEventMask : ULONG; lpAdviseSink : IMAPIAdviseSink;
  589.         var lpulConnection : ULONG) : HResult; stdcall;
  590.       function Unadvise (ulConnection : ULONG) : HResult; stdcall;
  591.       function OpenStatusEntry (lpInterface : PIID; ulFlags : ULONG;
  592.         var lpulObjType : ULONG; var lppEntry : Pointer) : HResult; stdcall;
  593.     end;
  594.  
  595. { Message Store Provider Entry Point }
  596.  
  597. {!! Note: Message store providers export a function called "MSProviderInit"
  598.   following the syntax of this function declaration }
  599.  
  600.   TMSPROVIDERINIT = function (hInstance : HINST;
  601.     lpMalloc : IMalloc; { AddRef() if you keep it }
  602.     lpAllocateBuffer : PALLOCATEBUFFER; { -> AllocateBuffer }
  603.     lpAllocateMore : PALLOCATEMORE; { -> AllocateMore   }
  604.     lpFreeBuffer : PFREEBUFFER; { -> FreeBuffer     }
  605.     ulFlags : ULONG; ulMAPIVer : ULONG; var lpulProviderVer : ULONG;
  606.     var lppMSProvider : IMSProvider) : HResult; cdecl;
  607.  
  608. {******************************************************************}
  609. {                                                                  }
  610. {                    MESSAGE SERVICE CONFIGURATION                 }
  611. {                                                                  }
  612. {******************************************************************}
  613.  
  614. { Flags for service configuration entry point }
  615.  
  616. { #define MAPI_UNICODE              0x80000000 }
  617. { #define SERVICE_UI_ALWAYS         0x00000002 }
  618. { #define SERVICE_UI_ALLOWED        0x00000010 }
  619. const MSG_SERVICE_UI_READ_ONLY      = $00000008 { display parameters only };
  620. const SERVICE_LOGON_FAILED          = $00000020 { reconfigure provider };
  621.  
  622. { Contexts for service configuration entry point }
  623.  
  624. const MSG_SERVICE_INSTALL          = $00000001;
  625. const MSG_SERVICE_CREATE           = $00000002;
  626. const MSG_SERVICE_CONFIGURE        = $00000003;
  627. const MSG_SERVICE_DELETE           = $00000004;
  628. const MSG_SERVICE_UNINSTALL        = $00000005;
  629. const MSG_SERVICE_PROVIDER_CREATE  = $00000006;
  630. const MSG_SERVICE_PROVIDER_DELETE  = $00000007;
  631.  
  632. { Prototype for service configuration entry point }
  633.  
  634. {!! Note: Providers may export a function following the syntax of this function
  635.   declaration }
  636.  
  637. type
  638.   TMSGSERVICEENTRY = function (hInstance : HINST; lpMalloc : IMalloc;
  639.     lpMAPISup : IMAPISupport; ulUIParam : ULONG; ulFlags : ULONG;
  640.     ulContext : ULONG; cValues : ULONG; lpProps : PSPropValue;
  641.     lpProviderAdmin : IProviderAdmin;
  642.     var lppMapiError : PMAPIERROR) : HResult; stdcall;
  643.  
  644.   PMSGSERVICEENTRY = ^TMSGSERVICEENTRY;
  645.  
  646. implementation
  647.  
  648. end.
  649.  
  650.